import service from "./axios";

//0.axios的返回Promise的类型
interface ResponseData{
    code:number,
    data:any,
    message:string
}


//1.封装Get请求
function get(url:string,params?:any):Promise<ResponseData>{
    return service.get(url,{params})
}


//2.封装Post请求
function post(url:string,data?:any):Promise<ResponseData>{
    return service.post(url,data)
}


//3.导出这个get、post请求
export {get,post}